import request from '@/utils/request'

// 查询用户信息列表
export function listMember(query) {
  return request({
    url: '/weiriya/member/list',
    method: 'get',
    params: query
  })
}

// 查询用户信息详细
export function getMember(id) {
  return request({
    url: '/weiriya/member/' + id,
    method: 'get'
  })
}

// 新增用户信息
export function addMember(data) {
  return request({
    url: '/weiriya/member',
    method: 'post',
    data: data
  })
}

// 修改用户信息
export function updateMember(data) {
  return request({
    url: '/weiriya/member',
    method: 'put',
    data: data
  })
}

// 删除用户信息
export function delMember(id) {
  return request({
    url: '/weiriya/member/' + id,
    method: 'delete'
  })
}

// 改变用户状态
export function putMemberStatus(data) {
  return request({
    url: '/weiriya/member/state',
    method: 'put',
    data: data
  })
}

// 会员续费
export function postRenew(data) {
  return request({
    url: '/weiriya/member/vip',
    method: 'post',
    data: data
  })
}

// 获取会员时间和价格
export function postVipInfo(data) {
  return request({
    url: '/weiriya/member/getVipInfo',
    method: 'post',
    data: data
  })
}

// 获取会员有效期记录
export function getMemberVipRecord(memberId) {
  return request({
    url: '/weiriya/payVipRecord/effectiveList/' + memberId,
    method: 'get'
  })
}